From: Florian Müllner Date: Tue, 13 Jun 2017 04:49:07 +0000 (+0200) Subject: Don't use 'undefined' as boolean X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~271 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e2f88d67f7d6d9f02a80f6867f905055827ac424;p=gnome-shell.git Don't use 'undefined' as boolean Make sure we pass a proper false value instead of undefined to avoid warnings. https://bugzilla.gnome.org/show_bug.cgi?id=781471 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 2eaa51948..67ba8b88b 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -607,7 +607,7 @@ const Keyboard = new Lang.Class({ shouldTakeEvent: function(event) { let actor = event.get_source(); return Main.layoutManager.keyboardBox.contains(actor) || - actor._extended_keys || actor.extended_key; + !!actor._extended_keys || !!actor.extended_key; }, _clearKeyboardRestTimer: function() { diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 62096258d..315bfdb17 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -391,10 +391,10 @@ const FdoNotificationDaemon = new Lang.Class({ notification.setUrgency(MessageTray.Urgency.CRITICAL); break; } - notification.setResident(hints.resident == true); + notification.setResident(!!hints.resident); // 'transient' is a reserved keyword in JS, so we have to retrieve the value // of the 'transient' hint with hints['transient'] rather than hints.transient - notification.setTransient(hints['transient'] == true); + notification.setTransient(!!hints['transient']); let sourceGIcon = source.useNotificationIcon ? gicon : null; source.processNotification(notification, sourceGIcon);